<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>敏感数据自动化脱敏系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        :root {
            --primary-color: #2A5CAA;
            --secondary-color: #5B8FB9;
            --background-color: #F5F9FF;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
        }

        .container {
            display: flex;
            min-height: 100vh;
            background: white;
        }

        /* 左半部分 - 宣传区 */
        .banner {
            flex: 1;
            background: var(--background-color);
            padding: 4rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
            min-width: 600px;
        }

        .slogan {
            color: var(--primary-color);
            max-width: 600px;
        }

        .slogan h1 {
            font-size: 2.8rem;
            line-height: 1.3;
            margin-bottom: 2rem;
            font-weight: 600;
        }

        .feature-list {
            list-style: none;
            margin-top: 3rem;
        }

        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 2rem;
        }

        .feature-icon {
            font-size: 1.8rem;
            color: var(--secondary-color);
            margin-right: 1.5rem;
            width: 40px;
        }

        .feature-text h3 {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
        }

        .feature-text p {
            color: #666;
            line-height: 1.6;
        }

        /* 右半部分 - 功能区 */
        .auth-box {
            flex: 1;
            max-width: 50%;
            padding: 6rem 4rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            background: white;
        }

        .auth-tabs {
            display: flex;
            margin-bottom: 2.5rem;
            border-bottom: 2px solid #eee;
        }

        .auth-tab {
            flex: 1;
            padding: 1.2rem;
            text-align: center;
            cursor: pointer;
            color: #999;
            font-weight: 500;
            transition: all 0.3s;
        }

        .auth-tab.active {
            color: var(--primary-color);
            border-bottom: 3px solid var(--primary-color);
            margin-bottom: -2px;
        }

        .form-group {
            margin-bottom: 1.8rem;
        }

        .input-field {
            width: 100%;
            padding: 14px 18px;
            border: 2px solid #e0e7ff;
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.3s;
        }

        .input-field:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(42,92,170,0.1);
        }

        .login-btn {
            width: 100%;
            padding: 16px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.3s;
        }

        .login-btn:hover {
            background: #1F4A87;
        }

        .alert-error {
            color: #dc3545;
            margin: 1.5rem 0;
            text-align: center;
            padding: 12px;
            background: #f8d7da;
            border-radius: 6px;
        }

        /* 新增表单切换动画 */
    .auth-form {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        display: none;
    }
    
    .auth-form.active {
        opacity: 1;
        transform: translateY(0);
        display: block;
    }

    /* 新增选项卡滑动效果 */
    .auth-tab.active {
        position: relative;
    }
    .auth-tab.active::after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        animation: tabSlide 0.3s ease-out;
    }
    @keyframes tabSlide {
        from { width: 0; }
        to { width: 100%; }
    }

    </style>
</head>
<body>
    <div class="container">
        <!-- 左半部分：宣传区 -->
        <div class="banner">
            <div class="slogan">
                <h1>敏感数据自动化脱敏系统</h1>
                <ul class="feature-list">
                    <li class="feature-item">
                        <i class="fas fa-shield-alt feature-icon"></i>
                        <div class="feature-text">
                            <h3>全流程安全防护</h3>
                            <p>确保数据处理安全</p>
                        </div>
                    </li>
                    <li class="feature-item">
                        <i class="fas fa-bolt feature-icon"></i>
                        <div class="feature-text">
                            <h3>高效智能脱敏</h3>
                            <p>支持多种脱敏方式</p>
                        </div>
                    </li>
                    <li class="feature-item">
                        <i class="fas fa-project-diagram feature-icon"></i>
                        <div class="feature-text">
                            <h3>多级权限管理</h3>
                            <p>操作记录留档可追溯</p>
                        </div>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 右半部分：功能区 -->
        <div class="auth-box">
            <div class="auth-tabs">
                <div class="auth-tab active" onclick="showForm('login')">用户登录</div>
                <div class="auth-tab" onclick="showForm('register')">新用户注册</div>
            </div>

            <!-- 登录表单 -->
            <form method="POST" class="auth-form active" id="login-form">
                <input type="hidden" name="action" value="login">
                <div class="form-group">
                    <input type="text" class="input-field" name="username" placeholder="请输入用户名" required>
                </div>
                <div class="form-group">
                    <input type="password" class="input-field" name="password" placeholder="请输入密码" required>
                </div>
                <button type="submit" class="login-btn">立即登录</button>
            </form>

            <!-- 注册表单 -->
            <form method="POST" class="auth-form" id="register-form">
                <input type="hidden" name="action" value="register">
                <div class="form-group">
                    <input type="text" class="input-field" name="username" placeholder="设置用户名" required>
                </div>
                <div class="form-group">
                    <input type="password" class="input-field" name="password" placeholder="设置登录密码" required>
                </div>
                <button type="submit" class="login-btn">立即注册</button>
            </form>

            <!-- 系统消息提示 -->
            {% with messages = get_flashed_messages() %}
                {% if messages %}
                    <div class="alert-error">
                        {{ messages[0] }}
                    </div>
                {% endif %}
            {% endwith %}
        </div>
    </div>

    <script>
        // 增强版表单切换逻辑
        function showForm(formType) {
            // 获取元素
            const tabs = document.querySelectorAll('.auth-tab');
            const forms = document.querySelectorAll('.auth-form');
            const targetTab = document.querySelector(`.auth-tab:nth-child(${formType === 'login' ? 1 : 2})`);
            const targetForm = document.getElementById(`${formType}-form`);
    
            // 禁用重复点击
            if (targetTab.classList.contains('active')) return;
    
            // 切换选项卡
            tabs.forEach(tab => tab.classList.remove('active'));
            targetTab.classList.add('active');
    
            // 切换表单动画
            forms.forEach(form => {
                if (form.classList.contains('active')) {
                    form.style.opacity = '0';
                    form.style.transform = 'translateY(-10px)';
                    setTimeout(() => {
                        form.classList.remove('active');
                        targetForm.classList.add('active');
                        targetForm.style.opacity = '0';
                        targetForm.style.transform = 'translateY(10px)';
                        setTimeout(() => {
                            targetForm.style.opacity = '1';
                            targetForm.style.transform = 'translateY(0)';
                        }, 10);
                    }, 300);
                }
            });
        }
    </script>
</body>
</html>